package org.upal.springMb.service.admin.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.upal.springMb.domain.admin.User;
import org.upal.springMb.exception.SprMException;
import org.upal.springMb.mapper.admin.UserMapper;
import org.upal.springMb.service.admin.UserService;

@Service("userService")
@Transactional(readOnly=false,rollbackFor={RuntimeException.class,Exception.class})
public class UserServiceImpl implements UserService {

	@Autowired(required=true)
	private UserMapper userMapper;
	
	/**
	 * 添加用户
	 * @param user
	 */
	public void saveUser(User user){
		try{
			userMapper.save(user);
			System.out.println("saveUser");
			int i = 10/0;
			System.out.println(i);
		}catch(Exception e){
				throw new SprMException("添加用户时出现异常",e);
			}
		}
	}	

